home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Game-Power
/
Amiga Game-Power.iso
/
anwendungen
/
gw print
/
structurebrowser_v1.3
/
sources
/
sbmenu.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-20
|
5KB
|
166 lines
/*
Handles the Intuition Menu and MenuItem structures
*/
#include "header/sb.h"
extern int level; /* recursion level */
/* PrMenu
Put up the data for a Menu structure.
*/
PrMenu (string, menu)
char *string;
struct Menu *menu;
{
static struct StructData structdata[] = {
{ " NextMenu", "struct Menu *", PRPTR, PTRSIZE },
{ "-LeftEdge", "SHORT", PRINT, INTSIZE },
{ "-TopEdge", "SHORT", PRINT, INTSIZE },
{ "-Width", "SHORT", PRINT, INTSIZE },
{ "-Height", "SHORT", PRINT, INTSIZE },
{ " Flags", "USHORT", PRUINT, INTSIZE },
{ " MenuName", "BYTE *", PRSTRING, PTRSIZE },
{ " FirstItem", "struct MenuItem *", PRPTR, PTRSIZE },
{ "-JazzX", "USHORT", PRUBYTE, INTSIZE },
{ "-JazzY", "USHORT", PRUBYTE, INTSIZE },
{ "-BeatX", "USHORT", PRUBYTE, INTSIZE },
{ "-BeatY", "USHORT", PRUBYTE, INTSIZE }
};
static char *flagnames[16] = {
"MENUENABLED", NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
"MIDRAWN"
};
int i, sum;
int choice = -1;
USHORT bits;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)menu, DATASIZE, 0);
switch (choice = GetChoice(DATASIZE))
{
case 1:
if (menu->NextMenu)
PrMenu("The next Menu in Intuition's list", menu->NextMenu);
break;
case 6:
FlagPrint("Flags set for this Menu", flagnames,
(ULONG)menu->Flags);
break;
case 7:
PrString("The Menu's Header", menu->MenuName);
break;
case 8:
if (menu->FirstItem)
PrMenuItem("The first MenuItem for this Menu",
menu->FirstItem);
break;
}
}
level--;
}
PrMenuItem (string, menuitem)
char *string;
struct MenuItem *menuitem;
{
static struct StructData structdata[] = {
{ " NextItem", "struct MenuItem *", PRPTR, PTRSIZE },
{ "-LeftEdge", "SHORT", PRINT, INTSIZE },
{ "-TopEdge", "SHORT", PRINT, INTSIZE },
{ "-Width", "SHORT", PRINT, INTSIZE },
{ "-Height", "SHORT", PRINT, INTSIZE },
{ " Flags", "USHORT", PRUINT, INTSIZE },
{ "-MutualExclude", "LONG", PRLONG, PTRSIZE },
{ " ItemFill", "APTR", PRPTR, PTRSIZE },
{ " SelectFill", "APTR", PRPTR, PTRSIZE },
{ "-Command", "BYTE", PRBYTE, INTSIZE },
{ " SubItem", "struct MenuItem *", PRPTR, PTRSIZE },
{ "-NextSelect", "USHORT", PRUINT, INTSIZE }
};
static char *flagnames[16] = {
"CHECKIT", "ITEMTEXT", "COMMSEQ", "MENUTOGGLE",
"ITEMENABLED", NULL, "HIGHCOMP", "HIGHBOX",
"CHECKED", NULL, NULL, NULL,
"ISDRAWN", "HIGHITEM", "MENUTOGGLED"
};
int i, sum;
int choice = -1;
USHORT bits;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)menuitem, DATASIZE, 0);
switch (choice = GetChoice(DATASIZE))
{
case 1:
if (menuitem->NextItem)
PrMenuItem("The next Menu in Intuition's list",
menuitem->NextItem);
break;
case 6:
bits = menuitem->Flags;
switch ((bits & HIGHFLAGS) >> 6)
{
case 0:
flagnames[6] = "HIGHIMAGE";
bits |= 0x40;
break;
case 1:
flagnames[6] = "HIGHCOMP";
break;
case 2:
flagnames[7] = "HIGHBOX";
break;
case 3:
flagnames[7] = "HIGHNONE";
bits ^= 0x40;
break;
}
FlagPrint("Flags set for this MenuItem", flagnames,
(ULONG)bits);
break;
case 8:
if (menuitem->ItemFill)
if (menuitem->Flags & ITEMTEXT)
PrIText("The IntuiText for this MenuItem",
menuitem->ItemFill);
/* else
PrImage("The Image structure for this MenuItem",
menutitem->ItemFill); */
break;
case 9:
if (menuitem->SelectFill)
if (menuitem->Flags & ITEMTEXT)
PrIText("The IntuiText for this MenuItem when highlighted",
menuitem->ItemFill);
/* else
PrImage("The Image structure for this MenuItem",
menutitem->ItemFill); */
break;
case 10:
if (menuitem->SubItem)
PrMenuItem("The first SubItem for this MenuItem",
menuitem->SubItem);
break;
}
}
level--;
}